#ifndef __CONTROLLOOP_H
#define __CONTROLLOOP_H

#include "motor.h"

#define MINSPEED 0//0//50//200

#define NoLoadIdAMP 3500//2048//512//1024//2048

#define SPEED_LIMIT  20000

#define Speed_Step 20//

typedef struct
{
		uint16_t nominal_speed;
    int16_t ref_vel;
    int16_t arrange_vel;
    int16_t ramp_vel ;
    int16_t step_up;
    int16_t step_down;
    int16_t diff_vel ;
    uint16_t acc_time;
} Motor_t;
extern Motor_t m1;
void Speed_Ramp_Init(void);
int16_t Velocity_ramp_arrangement(void);

void OutsideLoopInit(void);
void OutsideLoopCalc(void);

void Id_Calc(void);

#endif
